# 玫瑰花数

s = []
for i in range(1000, 10000):
    b = str(i)
    a = 0
    for j in b:
        a += float(j)**4
    if a == i:
        print(b)